#ifndef __LCDINIT_H
#define	__LCDINIT_H

#include "main.h"

typedef __IO uint16_t vu16;

#define LCD_BASE0 (0x60000000)
#define LCD_BASE1 (0x60080000)//1<<19
#define ST7789_CMD_CASETF 0x2A
#define ST7789_CMD_RASETF 0x2B
#define ST7789_CMD_RAMWR  0x2C
#define LCD_Width  240
#define LCD_Height 320


#define LCD_CmdWrite(cmd) *(vu16 *)(LCD_BASE0) = (cmd)
#define LCD_DataWrite(data) *(vu16 *)(LCD_BASE1) = (data)
#define LCD_StatusRead() *(vu16 *)(LCD_BASE0) //if use read  Mcu interface DB0~DB15 needs increase pull high
#define LCD_DataRead() *(vu16 *)(LCD_BASE1)   //if use read  Mcu interface DB0~DB15 needs increase pull high


void lcd_init();
void lcd_SetColor(uint32_t color);
void lcddrv_FillColorPre(uint16_t X, uint16_t Y,uint16_t color);
//void lcddrv_FillColorPre(uint16_t _usX, uint16_t _usY, uint16_t _usWidth , uint16_t _usHeight, uint16_t color);

#endif
